package com.msb.gatewaysentinel.filter;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/****************************************************
 * 自定义Gateway 过滤器
 *
 * @author lbf
 * @date 2025/7/29 9:50
 ****************************************************/
public class MtGatewayFilter implements Ordered, GlobalFilter {

    /**
     *
     * @param exchange  本次请求的数据，如请求参数、属性信息、当前容器的上下文信息、Session等等
     * @param chain  过滤器链
     * @return
     */
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {

        //获取请求
        ServerHttpRequest request = exchange.getRequest();


        return chain.filter(exchange);
    }

    @Override
    public int getOrder() {
        return 0;
    }
}
